// Copyright 2008 web2me.dev
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package net.web2me.api;

import java.util.Properties;

/**
 * Provides the behavior to use parsers.
 * 
 * @author web2me
 * 
 */
public interface Parsable {

	/**
	 * Process the site stream according to the implementation provided
	 * 
	 * @param siteStream
	 * @throws ParserException
	 */
	public void process(String siteStream) throws ParserException,
			ProcessFinishedException;

	/**
	 * Returns the directory (if applicable)
	 * 
	 * @return the directory
	 */
	public String getDir();

	/**
	 * Set the directory (if applicable)
	 * 
	 * @param dir
	 *            the directory to set
	 */
	public void setDir(String dir);

	/**
	 * Returns the URL
	 * 
	 * @return the URL
	 */
	public String getUrl();

	/**
	 * Sets the URL
	 * 
	 * @param url
	 *            the URL
	 */
	public void setUrl(String url);

	/**
	 * This is a list of supported file types
	 * 
	 * @return The file types supported
	 */
	public String[] getFileTypes();

	/**
	 * Set the file types supported
	 * 
	 * @param types
	 *            A list of file types
	 */
	public void setFileTypes(String[] types);

	/**
	 * Gets the parser properties specified in the <i>parser.properties</i> file
	 * 
	 * @return the parser properties
	 */
	public Properties getProperties();

	/**
	 * Sets the properties after being retrieved from the
	 * <i>parser.properties</i> file
	 * 
	 * @param properties
	 *            The properties
	 */
	public void setProperties(Properties properties);

	/**
	 * Gets the {@link Parsable} description
	 * 
	 * @return
	 */
	public String getDescription();
	
	public String getName();

}
